Found 9 posts.
Search results Show results as topic list.
Technical Discussion » Wireframe mesh is different after going through ROP>Alembic
- Mike Vasiljevs
- 9 posts
- Offline
Looks like polys are triangulated. Check the Maximum Edges parameter of the PolySoup node (described in docs, haven't tried myself yet).
Technical Discussion » Surface Length to Domain parameter
- Mike Vasiljevs
- 9 posts
- Offline
Is there a quick way to do an arc length evaluation of a position on the surface - similar to uniform texture coordinate construction (uniformTexture()?)?
At the moment I have to do a workaround by constructing a curve and then using unitLengthToUnitDomain(); for example getting a position using curve u(s) parameter:
float unit_u = curve->unitLengthToUnitDomain(unit_s);
surface->evaluate(unit_u * num_segments, v, pos);
At the moment I have to do a workaround by constructing a curve and then using unitLengthToUnitDomain(); for example getting a position using curve u(s) parameter:
float unit_u = curve->unitLengthToUnitDomain(unit_s);
surface->evaluate(unit_u * num_segments, v, pos);
Technical Discussion » HDK plugin loading troubleshooting
- Mike Vasiljevs
- 9 posts
- Offline
I had a similar issue in the beginning. I would recommend checking the compiler flags and that the linked libraries are copied into the right locations (Dependency Walker helps if you are running Windows).
In particular check that you link against Release runtime (/MD for Visual C++ dll) even if you make a debug build.
EDIT: Also defines. I have the following defines, adjust the version accordingly:
“WIN32”,
“_USE_MATH_DEFINES”,
“_DLL”,
“BOOST_ALL_DYN_LINK”,
“VERSION=\”13.0.476\“”,
“NOMINMAX”,
“_USE_MATH_DEFINES”,
“_CRT_SECURE_NO_DEPRECATE”,
“_CRT_NONSTDC_NO_DEPRECATE”,
“_SCL_SECURE_NO_WARNINGS”,
“BOOST_ALL_NO_LIB”,
“MAKING_DSO”,
In particular check that you link against Release runtime (/MD for Visual C++ dll) even if you make a debug build.
EDIT: Also defines. I have the following defines, adjust the version accordingly:
“WIN32”,
“_USE_MATH_DEFINES”,
“_DLL”,
“BOOST_ALL_DYN_LINK”,
“VERSION=\”13.0.476\“”,
“NOMINMAX”,
“_USE_MATH_DEFINES”,
“_CRT_SECURE_NO_DEPRECATE”,
“_CRT_NONSTDC_NO_DEPRECATE”,
“_SCL_SECURE_NO_WARNINGS”,
“BOOST_ALL_NO_LIB”,
“MAKING_DSO”,
Technical Discussion » Setting normals in a curve; Frenet Frame
- Mike Vasiljevs
- 9 posts
- Offline
edwardPardon me! I must have been reading that with my eyes closed!! :p
No, the “normal_attrib” variable in the snippet above is already of type GA_RWHandleV3.
Technical Discussion » Setting normals in a curve; Frenet Frame
- Mike Vasiljevs
- 9 posts
- Offline
Thank you for the reply.
I believe you have meant to get the GA_RWHandleV3 variable first, as set() absent from GA_Attribute class - also discussed in another thread http://www.sidefx.com/index.php?option=com_forum&Itemid=172&page=viewtopic&t=22762 [sidefx.com]
However that does not seem to affect evaluate functions much either!
I believe you have meant to get the GA_RWHandleV3 variable first, as set() absent from GA_Attribute class - also discussed in another thread http://www.sidefx.com/index.php?option=com_forum&Itemid=172&page=viewtopic&t=22762 [sidefx.com]
However that does not seem to affect evaluate functions much either!
Technical Discussion » Computing normals using the HDK
- Mike Vasiljevs
- 9 posts
- Offline
Many thanks for your feedback.
@Edward
It is good to know that normals need to be generated explicitly.
@Alexey
I had a look at the the Path Deformer plugin that you have developed, also I believe the curve is expected on the input with already computed normals.
However I can see how you are setting the tangent vectors, so I've adapted that part for the normal vectors:
GA_RWAttributeRef normal_attrib = gdp->addNormalAttribute(GA_ATTRIB_POINT, GA_STORE_REAL32);
GA_RWHandleV3 normal_attribv3 = normal_attrib.getAttribute();
// …
normal_attribv3.set(point_offset, normal);
However this setting the attribute this way does not seem to affect the evaluated normals.
It is interesting (and also weird!) that the evaluateNormalVector() always results in the up (0, 1, 0) vector; but evaluateFrenetFrame() sets normal vector to quite different values!
I will take a look at PolyFrame SOP.
@Edward
It is good to know that normals need to be generated explicitly.
@Alexey
I had a look at the the Path Deformer plugin that you have developed, also I believe the curve is expected on the input with already computed normals.
However I can see how you are setting the tangent vectors, so I've adapted that part for the normal vectors:
GA_RWAttributeRef normal_attrib = gdp->addNormalAttribute(GA_ATTRIB_POINT, GA_STORE_REAL32);
GA_RWHandleV3 normal_attribv3 = normal_attrib.getAttribute();
// …
normal_attribv3.set(point_offset, normal);
However this setting the attribute this way does not seem to affect the evaluated normals.
It is interesting (and also weird!) that the evaluateNormalVector() always results in the up (0, 1, 0) vector; but evaluateFrenetFrame() sets normal vector to quite different values!
I will take a look at PolyFrame SOP.
Technical Discussion » Setting normals in a curve; Frenet Frame
- Mike Vasiljevs
- 9 posts
- Offline
I would like to ask how to set a normal vector when specifying control points in a curve. The purpose for this is to evaluate Frenet frame, evaluateFrenetFrame() at any point on the curve (e.g. to get position and normal vectors) - after the curve is constructed.
I have tried the example below for the NURBS Curve - evaluated normal is always a null vector:
// normal attribute - is this correct?
GA_AttributeOwner ao = GA_ATTRIB_POINT;
GA_RWAttributeRef normal_attrib = gdp->addNormalAttribute(ao, GA_STORE_REAL32);
// create a curve
GU_PrimNURBCurve *curve = GU_PrimNURBCurve::build(gdp, num_points, degree);
// set knot values values
for (int point_idx = 0; point_idx < num_points; point_idx++)
{
// compute position vector etc. …
point_offset = curve->getPointOffset(point_idx);
gdp->setPos4(point_offset, position_vec4);
if (normal_attrib)
{
GEO_Point *p = gdp->getGEOPoint(point_offset);
//p->setPos(position_vec4);
const UT_Vector4 normal(0, 1, 0, 1);
// either of the three methods should work, right?
// 1
p->set(normal_attrib, normal.data(), 4);
// 2
//p->setValue(normal_attrib, normal);
// 3
//p->setValue(normal_attrib, 0.0f, 0);
//p->setValue(normal_attrib, 1.0f, 1);
//p->setValue(normal_attrib, 0.0f, 2);
//p->setValue(normal_attrib, 1.0f, 3);
}
}
I have tried the example below for the NURBS Curve - evaluated normal is always a null vector:
// normal attribute - is this correct?
GA_AttributeOwner ao = GA_ATTRIB_POINT;
GA_RWAttributeRef normal_attrib = gdp->addNormalAttribute(ao, GA_STORE_REAL32);
// create a curve
GU_PrimNURBCurve *curve = GU_PrimNURBCurve::build(gdp, num_points, degree);
// set knot values values
for (int point_idx = 0; point_idx < num_points; point_idx++)
{
// compute position vector etc. …
point_offset = curve->getPointOffset(point_idx);
gdp->setPos4(point_offset, position_vec4);
if (normal_attrib)
{
GEO_Point *p = gdp->getGEOPoint(point_offset);
//p->setPos(position_vec4);
const UT_Vector4 normal(0, 1, 0, 1);
// either of the three methods should work, right?
// 1
p->set(normal_attrib, normal.data(), 4);
// 2
//p->setValue(normal_attrib, normal);
// 3
//p->setValue(normal_attrib, 0.0f, 0);
//p->setValue(normal_attrib, 1.0f, 1);
//p->setValue(normal_attrib, 0.0f, 2);
//p->setValue(normal_attrib, 1.0f, 3);
}
}
Technical Discussion » HDK Forum !!!
- Mike Vasiljevs
- 9 posts
- Offline
Hello,
I am just new to the forums, but it seems like a very very good idea. Having previously developed plugins for After Effects and Nuke, I really appreciated that Adobe and Foundry have had separate forums for native plugin development - even separate from scripting!! - discussions can get very involved and confusing even without posts targeting other technologies.
I am just new to the forums, but it seems like a very very good idea. Having previously developed plugins for After Effects and Nuke, I really appreciated that Adobe and Foundry have had separate forums for native plugin development - even separate from scripting!! - discussions can get very involved and confusing even without posts targeting other technologies.
Technical Discussion » Computing normals using the HDK
- Mike Vasiljevs
- 9 posts
- Offline
I would like to ask how to set normals when creating a curve (for example a GU_PrimNURBCurve)?
When you create a curve it is not quite clear what the value of the normal vector of a control vertex should be - they are generated automatically if I am correct? On the other hand it is of course quite unambiguous when you are dealing with a surface.
It seems that there are no built-in point attributes - by looking at the attribute name for each of the items from gdp->getAttributeDict(); I have also tried looking at vertex attributes - but I assume that normals belong to the shared set of values.
Should addNormalAttribute() be used? But adding points in the new HDK (Houdini version 13.0.476) appears to occur as follows:
point_offset = curve->getPointOffset(point_idx);
gdp->setPos4(point_offset, position_vec4);
Would be grateful for some pointers.
When you create a curve it is not quite clear what the value of the normal vector of a control vertex should be - they are generated automatically if I am correct? On the other hand it is of course quite unambiguous when you are dealing with a surface.
It seems that there are no built-in point attributes - by looking at the attribute name for each of the items from gdp->getAttributeDict(); I have also tried looking at vertex attributes - but I assume that normals belong to the shared set of values.
Should addNormalAttribute() be used? But adding points in the new HDK (Houdini version 13.0.476) appears to occur as follows:
point_offset = curve->getPointOffset(point_idx);
gdp->setPos4(point_offset, position_vec4);
Would be grateful for some pointers.
-
- Quick Links